OnFinishEvent

data class OnFinishEvent(val finalOutput: Any?, val totalSteps: Int, val usage: Usage, val pendingApprovals: List<PendingApproval> = emptyList(), val messages: List<ModelMessage> = emptyList(), val experimental_context: Any? = null)

Constructors

Link copied to clipboard
constructor(finalOutput: Any?, totalSteps: Int, usage: Usage, pendingApprovals: List<PendingApproval> = emptyList(), messages: List<ModelMessage> = emptyList(), experimental_context: Any? = null)

Properties

Link copied to clipboard

Final typed context after any prepareStep.experimental_context overrides — the value ToolExecutionContext.context carried on the last step. Mirrors v6's OnFinishEvent.experimental_context (per historical parity gap #36). Null when no override happened (the call started with options = null). Typed as Any? at the erasure-friendly hook surface; consumers cast to their TContext when they need it.

Link copied to clipboard
Link copied to clipboard

Final accumulated message list at the end of this generation (system + user + assistant + tool messages). Hosts use this to resume after a tool-approval pause without re-walking the events themselves: agent.generate(messages = onFinish.messages + approvalResponse).

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard